package com.wwe.kotlinstudy.dm.four;

/**
 * 双重校验锁式
 */
public class DoubleCheckJava {

    private volatile static DoubleCheckJava instance;

    private DoubleCheckJava() {
    }

    public static DoubleCheckJava getInstance() {
        if (instance == null) {
            synchronized (DoubleCheckJava.class) {
                if (instance == null) {
                    instance = new DoubleCheckJava();
                }
            }
        }
        return instance;
    }

}
